
package com.ahdy.controller;

import com.ahdy.pojo.DailyRecipe;
import com.ahdy.tool.Result;
import com.google.gson.Gson;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("Ai")
public class AIController {
    private String data;
    private DailyRecipe dailyRecipe;
    @PostMapping("/wen")
    public Result inquire(@RequestParam("question") String question) throws Exception {

        return new Result(200, null,"请求成功");
    }
    public void setdata(String data){
        this.data=data;
    }
    public void goobject(String data){
        System.out.println("data = " + data);
        data = data.replace("```json","");
        data = data.replace("```","");
        Gson gson = new Gson();
        dailyRecipe = gson.fromJson(data, DailyRecipe.class);
    }
}
